package https

func Get(url string, res ...interface{}) error {
	return do(url, nil, res...).Get()
}

func Post(url string, req interface{}, res ...interface{}) error {
	return do(url, req, res...).Post()
}

func Put(url string, req interface{}, res ...interface{}) error {
	return do(url, req, res...).Put()
}

func Delete(url string, req interface{}, res ...interface{}) error {
	return do(url, req, res...).Delete()
}

//--------------------

func do(url string, req interface{}, res ...interface{}) Interface {
	l := New(url).Req(req)
	if len(res) > 0 {
		l = l.Res(res[0])
	}
	return l
}
